<%--
  Created by IntelliJ IDEA.
  User: pc
  Date: 2017/11/18
  Time: 22:31
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>login</title>
</head>
<script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
<body>
<div>
    用户名：<input type="text" id="uname"/>
    <br/><br/>
    密码：<input type="password" id="pwd"/>
    <br/><br/>
    <input type="button" value="登录" onclick='login($("#uname").val(),$("#pwd").val())'/>&nbsp;&nbsp;<input type="button" value="注册"/>
</div>
</body>
<script>
    function login(uname,pwd) {
        $.post("/user/login.do",{uname:uname,pwd:pwd},function (data) {
            if(data==1){
                window.location.replace("http://localhost:8080/jsp/detailed.jsp");
            }else{
                alert("用户名或密码错误")
            }
        });
    }
</script>
</html>
